#include <systime.h>

#if DEVICE_PLATFORM_CONFIGURE != DEVICE_PLATFORM_LINUX
static sysTmTp globalSysTimrMs = 0;// for mcu
#endif

sysTmTp sysTmNow()
{
#if DEVICE_PLATFORM_CONFIGURE == DEVICE_PLATFORM_LINUX
    struct timespec tnow;
    clock_gettime(CLOCK_MONOTONIC, &tnow);
    return (sysTmTp)(tnow.tv_sec) * 1000 + tnow.tv_nsec / 1000000;
#else
    return globalSysTimrMs;// for mcu
#endif
}

#if DEVICE_PLATFORM_CONFIGURE != DEVICE_PLATFORM_LINUX
void sysTmUp(sysTmTp runms)
{
    globalSysTimrMs += runms;// for mcu
}
#endif